package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.UnionWarActivityServerProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_UNION_WAR_FINALS_RESULT_OR_MATCH_REQ, desc = "决赛匹配或结果数据")
public class CrossCrossFinalsResultOrMatchInfoReqCmd extends CrossUnionCommand {


    private int activityId;
    private int session;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        UnionWarActivityServerProto.CrossFinalsResultOrMatchInfoReqMsg reqMsg = UnionWarActivityServerProto.CrossFinalsResultOrMatchInfoReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        session = reqMsg.getSession();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarMgr.getFinalsResultOrMatchInfo(serverId, packet.getPlayerId(), activityId, session);
    }

    @Override
    public void sendData() {

    }
}
